Skip to content

Add C# Advent of Code automation framework with input fetching, testing, and submission#2

Draft
Copilot wants to merge 5 commits intomasterfrom
copilot/create-advent-of-code-template
Draft

Add C# Advent of Code automation framework with input fetching, testing, and submission#2
Copilot wants to merge 5 commits intomasterfrom
copilot/create-advent-of-code-template

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 12, 2025

Implements a complete automation framework for Advent of Code in C# to eliminate manual input fetching, enable test-driven development, and streamline answer submission.

Core Services

  • AoCConfig: Session cookie management via file (.aoc-session), environment variable, or interactive CLI
  • AoCClient: HTTP client for AOC API - fetches inputs, submits answers, parses responses (correct/incorrect/rate-limited)
  • Enhanced AoCDay: Base class now supports test cases, automatic input fetching with caching, and async submission

CLI Interface

dotnet run --project AoC -- -y 2025 -d 1 -t -s  # Run with tests and submission
dotnet run --project AoC -- --configure         # Setup session cookie

Arguments: -y/--year, -d/--day, -t/--test, -s/--submit, -c/--configure, -h/--help

Solution Template

public class Day01 : AoCDay
{
    public Day01()
    {
        AddTestCase(input: "sample", expectedPart1: "42", expectedPart2: "84");
    }

    public override string? SolvePart1(string[] input) { /* impl */ }
    public override string? SolvePart2(string[] input) { /* impl */ }
}

Test cases validate solutions before running on real input. Input auto-fetches and caches on first run.

Project Updates

  • Migrated to .NET 8.0
  • Simplified .csproj to use wildcards for input files (Input\**\*.txt)
  • Fixed path resolution to use AppDomain.BaseDirectory instead of working directory
  • Added .aoc-session to .gitignore

Documentation

  • README.md: Complete setup and API reference
  • QUICKSTART.md: 5-minute getting started guide
  • DayTemplate.cs.template: Copy-paste template for new solutions

Security: CodeQL analysis clean. No credentials in code or version control.

Original prompt

This section details on the original issue you should resolve

<issue_title>Create an Advent of Code 2025 template with automated input fetching, testing, and submission</issue_title>
<issue_description>## Overview
Develop a template/script for Advent of Code 2025 that:

  • Automatically fetches the input file for a given problem and day from the Advent of Code website using the user's session cookie.
  • Provides an easy-to-use structure or harness for testing solutions locally with provided examples and real input.
  • Offers automated solution submission to Advent of Code site, capturing and displaying the result/status.

Features

  1. Input Automation
    • Fetch input file for a specific year and day based on user/session info.
    • Store inputs in a local directory for later runs.
  2. Testing
    • Integrate simple testing (using built-in asserts or a lightweight test framework) for checking solutions on sample input/output before running on real input.
    • Optionally allow user to provide more test cases.
  3. Submission Automation
    • Script to automatically submit answers to Advent of Code and process response, including handling of wrong-right answers, wait times, and reporting result to the user.
  4. Documentation & Setup
    • Instructions for configuring the session cookie securely.
    • Example usage to illustrate the workflow, e.g., python solve.py 2025 1 or similar.

Implementation Suggestions

  • Choose Python for initial script (or make language-agnostic if practical).
  • Separate configuration for session cookie/token to avoid accidental leaks.
  • User prompts or CLI arguments for year, day, and part selection.

Benefits

  • Saves time fetching/copying input and submitting answers manually.
  • Reduces repeated boilerplate for new days/problems.
  • Makes testing, development, and submission more reliable and streamlined.

Notes


This would improve usability, automation, and accelerate the workflow for Advent of Code 2025.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits November 12, 2025 15:57
…ng, and submission

Co-authored-by: Tim567 <24894554+Tim567@users.noreply.github.com>
Co-authored-by: Tim567 <24894554+Tim567@users.noreply.github.com>
Co-authored-by: Tim567 <24894554+Tim567@users.noreply.github.com>
Co-authored-by: Tim567 <24894554+Tim567@users.noreply.github.com>
Copilot AI changed the title [WIP] Create Advent of Code 2025 template with automated input fetching Add C# Advent of Code automation framework with input fetching, testing, and submission Nov 12, 2025
Copilot AI requested a review from Tim567 November 12, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create an Advent of Code 2025 template with automated input fetching, testing, and submission

2 participants